package phi.engine.actors
{
	import Box2D.Collision.Shapes.b2CircleShape;
	import Box2D.Collision.Shapes.b2PolygonShape;
	import Box2D.Common.Math.b2Vec2;
	import Box2D.Dynamics.Joints.b2RevoluteJointDef;
	import Box2D.Dynamics.b2Body;
	import Box2D.Dynamics.b2BodyDef;
	
	import flash.display.Sprite;
	import flash.geom.Point;
	
	import phi.engine.draw.RectangleSprite;
	import phi.engine.events.ActorEvent;
	import phi.engine.utils.PhiMathUtil;

	public class PolygonActor extends InteractiveActor
	{
		public function PolygonActor( options :ActorOptions = null )
		{
			super( options );
		}
		
		override protected function createCostume():void
		{
			costume = new RectangleSprite();
		}
		
		override protected function createBody():void
		{
			// Create body & fixture
			body = engine.game.world.CreateBody( new b2BodyDef() );
			body.SetUserData( this );
			body.CreateFixture2( b2PolygonShape.asBox( options.sizeInMeters.x/2, options.sizeInMeters.y/2 ), 1 );
		}
		
		override protected function optionsChangeHandler( event:ActorEvent ):void
		{
			super.optionsChangeHandler( event );
		}
	}
}